i18n: localize legacy channel names/descriptions + ringtone "None" (#165)#191
Merged
Conversation
) The three oldest notification channels (critical/warning/full) had their names/descriptions hard-coded in English in NotificationService, so an Arabic user saw English rows in system Settings → Notifications. Move the six strings to resources with values-ar translations and wire them up. To make translated names reach *upgraded* installs (not just fresh ones), the channel helpers no longer early-return when the channel already exists: re-calling createNotificationChannel with the same ID updates only name/description/group (Android ignores importance/vibration/lights/sound), so the #153 versioning and user customizations are preserved. Renamed to createOrUpdateAlertChannel / createOrUpdateSilentChannel to match. Ringtone fallback summary now reuses the existing (previously orphaned) pref_ringtone_silent string instead of a hard-coded "None", matching the system picker's own "Silent" option. Debug-only literals in BatteryInsightsActivity are commented as deliberately untranslated so future i18n sweeps skip them knowingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #165.
Problem
The three oldest notification channels (critical / warning / full) had their names and descriptions hard-coded in English in
NotificationService, where lint can't see them. Arabic users saw English rows in system Settings → Notifications. TheRingtonePreferencefallback summary was likewise a hard-coded"None".Changes
values-artranslations (critical/warning/full × name+description), and the three legacy channels now read them viacontext.getString(...).createNotificationChannelwith the same ID updates only name/description/group — Android ignores importance, vibration, lights and sound — so the Vibrate toggle can't take effect: deleted notification channels resurrect with their old settings #153 versioning and any user customization are preserved. Renamed tocreateOrUpdateAlertChannel/createOrUpdateSilentChannelto reflect the honest semantics. This benefits every channel (e.g. a locale switch now refreshes all names on next service start), not only the three legacy ones.pref_ringtone_silentstring instead of a literal"None". Visible text changes "None" → "Silent", which also matches the label on the system picker's own silent option.BatteryInsightsActivity(options array, "Reset ALL health data?" dialog + toasts) are commented as deliberately untranslated so future i18n sweeps skip them knowingly.Acceptance criteria
Verification
./gradlew :app:lintDebug→BUILD SUCCESSFUL, noMissingTranslationerrors (the repo treats that as an error, so a clean pass confirms every new string is translated). Compiles clean.Still needs on-device testing: install a build without this change, then install this build over it in an Arabic locale, and confirm the three channels flip to Arabic in Settings → Notifications on the upgraded install.
Notes for review
Related: #153 (channel recreation), #96/#98 (locale work), #42 (Arabic localization).
🤖 Generated with Claude Code